AC_INIT([Code Ports], [2014.01.19], [juanmabcmail@gmail.com], [codeports], ["http://code.google.com/p/codeports"])
AC_CONFIG_MACRO_DIR([autoconf.macro])
AC_CONFIG_AUX_DIR([autoconf.aux])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE(no-dist-gzip dist-bzip2)
LT_INIT([dlopen])

AC_SUBST(PACKAGE_AUTHOR, ["Juan Manuel Borges Caño"])
AC_SUBST(PACKAGE_DESCRIPTION, ["Multiple Purpose Code Amusements"])
AC_SUBST(PACKAGE_URL, ["http://code.google.com/p/codeports"])
AC_SUBST(PACKAGE_MONTH, [$(LANG=C date '+%B')])
AC_SUBST(PACKAGE_YEAR, [$(LANG=C date '+%Y')])
AC_SUBST(PACKAGE_DATE, [$(LANG=C date)])
AC_SUBST(PACKAGE_COPYRIGHT, ["2014 Juan Manuel Borges Caño"])

AC_SUBST(PACKAGE_PARSE, ["sed -e 's,\@<:@@\@:>@pkg\@<:@@\@:>@,\$(PACKAGE),g' -e 's,\@<:@@\@:>@pkgname\@<:@@\@:>@,\$(PACKAGE_NAME),g' -e 's,\@<:@@\@:>@pkgversion\@<:@@\@:>@,\$(PACKAGE_VERSION),g' -e 's,\@<:@@\@:>@pkgauthor\@<:@@\@:>@,\$(PACKAGE_AUTHOR),g' -e 's,\@<:@@\@:>@pkgmonth\@<:@@\@:>@,\$(PACKAGE_MONTH),g' -e 's,\@<:@@\@:>@pkgyear\@<:@@\@:>@,\$(PACKAGE_YEAR),g' -e 's,\@<:@@\@:>@pkgurl\@<:@@\@:>@,\$(PACKAGE_URL),g' -e 's,\@<:@@\@:>@pkgbugreport\@<:@@\@:>@,\$(PACKAGE_BUGREPORT),g' -e 's/\@<:@@\@:>@pkgdescription\@<:@@\@:>@/\$(PACKAGE_DESCRIPTION)/g' -e 's,\@<:@@\@:>@pkgdatadir\@<:@@\@:>@,\$(pkgdatadir),g'"])

AC_DEFINE(PACKAGE_AUTHOR, ["Juan Manuel Borges Caño"], [Define to the full name author of this package.])
AC_DEFINE(PACKAGE_URL, ["http://code.google.com/p/codeports"], [Define to the full url of this package.])
AC_DEFINE(PACKAGE_DATE, ["Jan 2014"], [Define to the full date of this package.])
AC_DEFINE(PACKAGE_COPYRIGHT, ["2014 Juan Manuel Borges Caño"], [Define to the full copyright of this package.])
AC_DEFINE(PACKAGE_LICENSE, ["GNU General Public License, Version 3, 29 June 2007 (GPLv3+)"], [Define to the full license of this package.])
AC_DEFINE(PACKAGE_DESCRIPTION, ["Multiple Purpose Code Amusements"], [Define to the full description of this package.])
AC_DEFINE(PACKAGE_TOOL, ["codeports - Code Ports, Multiple Purpose Code Amusements"], [Define to the full tool tag of this package.])

# Checks for programs.
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_LIBTOOL

# Checks for libraries.
SVGALIB_MODULES="svgalib formats"
PKG_CHECK_MODULES(CP_SVGALIB, $SVGALIB_MODULES)
AC_SUBST(CP_SVGALIB_CFLAGS)
AC_SUBST(CP_SVGALIB_LIBS)

FRAMEBUFFER_MODULES="libm formats"
PKG_CHECK_MODULES(CP_FRAMEBUFFER, $FRAMEBUFFER_MODULES)
AC_SUBST(CP_FRAMEBUFFER_CFLAGS)
AC_SUBST(CP_FRAMEBUFFER_LIBS)

SDL_MODULES="SDL"
PKG_CHECK_MODULES(CP_SDL, $SDL_MODULES)
AC_SUBST(CP_SDL_CFLAGS)
AC_SUBST(CP_SDL_LIBS)

X_MODULES="x"
PKG_CHECK_MODULES(CP_X, $X_MODULES)
AC_SUBST(CP_X_CFLAGS)
AC_SUBST(CP_X_LIBS)

ALSA_MODULES="alsa"
PKG_CHECK_MODULES(CP_ALSA, $ALSA_MODULES)
AC_SUBST(CP_ALSA_CFLAGS)
AC_SUBST(CP_ALSA_LIBS)

EVDEV_MODULES="libm"
PKG_CHECK_MODULES(CP_EVDEV, $EVDEV_MODULES)
AC_SUBST(CP_EVDEV_CFLAGS)
AC_SUBST(CP_EVDEV_LIBS)

GENERIC_MODULES="libm formats"
PKG_CHECK_MODULES(CP_GENERIC, $GENERIC_MODULES)
AC_SUBST(CP_GENERIC_CFLAGS)
AC_SUBST(CP_GENERIC_LIBS)

# Checks for header files.
AC_STDC_HEADERS

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_FILES([Makefile tests/evdev/Makefile tests/alsa/Makefile tests/svgalib/Makefile tests/framebuffer/Makefile tests/x/Makefile tests/sdl/Makefile tests/Makefile src/evdev/Makefile src/alsa/Makefile src/svgalib/Makefile src/framebuffer/Makefile src/Makefile tools/Makefile games/SpaceBattle/Makefile games/Makefile doc/Makefile])
AC_OUTPUT
